package entity.http;

import java.util.Map;

public class HttpEntity {
    protected String target;
    protected Map<String, String> headers;

    public String getTarget() {
        return target;
    }

    public void setTarget(String target) {
        this.target = target;
    }

    public Map<String, String> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String> headers) {
        this.headers = headers;
    }

    @Override
    public String toString(){
        StringBuilder sb = new StringBuilder();
        sb.append(this.target);
        sb.append("\r\n");
        for (Map.Entry<String, String> entry : this.headers.entrySet()){
            sb.append(entry.getKey() + ":" + entry.getValue());
            sb.append("\r\n");
        }

        return sb.toString();
    }
}
